<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateOrdersTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->string('sn', 32)->nullable();
            $table->integer('status')->default(1);
            $table->integer('pay_type')->default(2);
            $table->integer('pay_status')->default(0);
            $table->text('remark')->nullable();
            $table->integer('goods_number')->default(1);
            $table->decimal('price', 10, 2)->default(0);
            $table->integer('acquire_integral')->default(0);
            $table->integer('use_integral')->default(0);
            $table->decimal('pay_money', 10, 2)->default(0);
            $table->integer('wxpay_record_id')->nullable();
            $table->integer('shipping_status')->default(0);
            $table->timestamp('shipping_at')->nullable();
            $table->integer('will_take')->default(0);
            $table->string('express_type', 32)->nullable();
            $table->string('express_sn', 64)->nullable();
            $table->text('express_info')->nullable();
            $table->text('json')->nullable();
            $table->text('request_params')->nullable();
            $table->timestamp('pay_at')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('orders');
    }
}
